package Day13_StringBuilder类;

//录入一个字符串,实现反转打印
//StringBuilder反转功能
//转换成String

import java.util.Scanner;

public class demo02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串:");
        String s = sc.next();
        //1.把输入的String 转换成 StringBuilder
        StringBuilder sb = new StringBuilder(s);

        //2.反转方法
        sb.reverse();

        //3.StringBuilder 转换成 String
        String s1 = sb.toString();

        System.out.println("反转后的字符串是:" + s1);
    }
}
